package
{
	import flash.display.Shape;
	
	public class Laser extends Shape
	{
		public var radian_angle:Number;
		
		public function Laser(start_angle:Number, start_x:Number, start_y:Number)
		{
			this.radian_angle = start_angle * Math.PI / 180;
			
			this.graphics.lineStyle(2, 0xFFFFFF);
			this.graphics.moveTo(10, 0);
			this.graphics.lineTo(11, 0);
			
			this.x = start_x;
			this.y = start_y;
			this.rotation = start_angle;	
		}
		
		public function update_position():void
		{
			this.x += Math.cos(this.radian_angle) * 15;
			this.y += Math.sin(this.radian_angle) * 15;	
		}
		
		public function off_stage():Boolean
		{
			if ( this.x < -5 || this.y < -5 || this.x > (this.stage.stageWidth+20) || this.y > (this.stage.stageHeight+20) )
				return true;
			else
				return false;
		}

	}
}